'use strict'
import MMALL_COMM from 'util/comm.jsx';
const _comm = new MMALL_COMM();
class User {
    checkUserInfo(userInfo){
        if(!userInfo.username){
            return {
                status:false,
                msg:'用户名不能为空'
            }
        }
        else if(!userInfo.password){
            return {
                status:false,
                msg:"密码不能为空"
            }
        }
        return {
            status:true,
            msg:'通过验证'
        }
    }
    login(userInfo){
        return _comm.request({
            url     : _comm.getServerHost('/manage/user/login.do'),
            method  : 'POST',
            data    : {
                username : userInfo.username || '',
                password : userInfo.password || ''
            }
        })
    }
    logout(){
        return _comm.request({
            url     : _comm.getServerHost('/user/logout.do'),
            method  : 'POST',
        });       
    }
}
export default User